<?php
$widget_params = isset($widget_params) ? $widget_params : [];
$choice_code_name = \Illuminate\Support\Arr::get($widget_params, 'name', 'store');
$choice_code_key = \Illuminate\Support\Arr::get($widget_params, 'code', 'store');
$choice_noIds = \Illuminate\Support\Arr::get($widget_params, 'noIds', false);
$choice_value = \Illuminate\Support\Arr::get($widget_params, 'value', 0);
$choice_showAll = \Illuminate\Support\Arr::get($widget_params, 'showAll', true);
$_kvs = \App\Facade\Code::get($choice_code_key);
?>
<select name="{{$choice_code_name}}" id="{{$choice_code_name}}" class="layui-input"
        lay-filter="{{$choice_code_name}}">
    @if($choice_showAll)
        <option value="">{{$choice_showAll===true?__('common.all'):$choice_showAll}}</option>
    @endif
    @if(!empty($_kvs))
        @foreach($_kvs as $key=>$item)
            @if($choice_noIds && in_array($key,$choice_noIds))
                @continue
            @endif
            <option value="{{$key}}"
                    @if($choice_value?$key==$choice_value:$key===$choice_value) selected @endif>{{$item}}</option>
        @endforeach
    @endif
</select>
